/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package td1;

import java.text.NumberFormat;

/**
 * Implémentation d'un point en deux dimension
 * @author saluzzo
 */
public class Point {

    public Point(float x, float y) {
        X = x;
        Y = y;
    }

    public void affiche() {
        System.out.println("Je suis un point de coordonné ("+this.X+","+this.Y+")");
    }

    public String getCoordonnee() {
        NumberFormat format = NumberFormat.getInstance();
        format.setMinimumFractionDigits(0);
        return "("+format.format(this.X)+","+format.format(this.Y)+")";
    }

    public float getX() {
        return X;
    }

    public void setX(float X) {
        this.X = X;
    }

    public float getY() {
        return Y;
    }

    public void setY(float Y) {
        this.Y = Y;
    }
    
    public static void main(String[] args) {
        //Test unitaire
        new Point(0, 10);
    }

 

    private float X;
    private float Y;

}
